<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>登录</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="stylesheet" href="../css/amazeui.min.css"/>
    <link href="../css/dlstyle.css" rel="stylesheet" type="text/css">
    <script src="../js/jquery.min.js"></script>
    <script src="../js/amazeui.min.js"></script>

</head>

<body>

<div class="login-boxtitle">
    <a href="home/demo.html"><img alt="" src="../image/Logo.png"/></a>
</div>

<div class="res-banner">
    <div class="res-main">
        <div class="login-banner-bg"><span></span><!--<img src="../images/big.jpg" />--></div>
        <div class="login-box">

            <div class="am-tabs" id="doc-my-tabs">
                <ul class="am-tabs-nav am-nav am-nav-tabs am-nav-justify">
                    <li class="am-active"><a href="">账号登录</a></li>
                    <li><a href="">短信快捷登录</a></li>
                </ul>

                <div class="am-tabs-bd">
                    <div class="am-tab-panel am-active">
                        <form method="post">

                            <div class="user-email">
                                <label for="mobile1"><i class="am-icon-envelope-o"></i></label>
                                <input type="email" name="mobile" id="mobile1" placeholder="请输入账号">
                            </div>

                            <div class="user-pass">
                                <label for="passwordRepeat"><i class="am-icon-lock"></i></label>
                                <input type="password" name="password" id="passwordRepeat" placeholder="请输入密码">
                            </div>
                        </form>
                        <div class="login-links">
                            <label for="remember-me"><input id="remember-me" type="checkbox">记住密码</label>
                            <a href="#" class="am-fr">忘记密码</a>

                            <br/>
                        </div>
                        <div class="am-cf">
                            <input type="submit" onclick="pwdLogin()" name="" value="登录"
                                   class="am-btn am-btn-primary am-btn-sm am-fl">
                        </div>


                        <hr>
                        <div class="partner">
                            <h3>合作账号</h3>
                            <div class="am-btn-group">
                                <li><a href="#"><i class="am-icon-qq am-icon-sm"></i><span>QQ登录</span></a></li>
                                <li><a href="#"><i class="am-icon-weibo am-icon-sm"></i><span>微博登录</span> </a></li>
                                <li><a href="#"><i class="am-icon-weixin am-icon-sm"></i><span>微信登录</span> </a></li>
                            </div>


                        </div>

                    </div>

                    <div class="am-tab-panel">
                        <form method="post">
                            <div class="user-phone">
                                <label for="phone"><i class="am-icon-mobile-phone am-icon-md"></i></label>
                                <input type="tel" name="" id="phone" placeholder="请输入手机号">
                            </div>
                            <div class="verification">
                                <label for="code"><i class="am-icon-code-fork"></i></label>
                                <input type="tel" name="" id="code" placeholder="请输入验证码">
                                <button class="am-btn am-btn-default am-btn-xs imgcode">获取验证码</button>

                            </div>

                            <div class="am-cf">
                                <input type="submit" name="" value="登录" class="am-btn am-btn-primary am-btn-sm am-fl">
                            </div>

                        </form>



                    </div>

                    <script>
                        $(function () {
                            $('#doc-my-tabs').tabs();
                        })
                    </script>

                </div>

            </div>


        </div>
    </div>

    <div class="footer ">
        <div class="footer-hd ">
            <p>
                <a href="# ">恒望科技</a>
                <b>|</b>
                <a href="# ">商城首页</a>
                <b>|</b>
                <a href="# ">支付宝</a>
                <b>|</b>
                <a href="# ">物流</a>
            </p>
        </div>
        <div class="footer-bd ">
            <p>
                <a href="# ">关于恒望</a>
                <a href="# ">合作伙伴</a>
                <a href="# ">联系我们</a>
                <a href="# ">网站地图</a>
                <em>© 2015-2025 Hengwang.com 版权所有</em>
            </p>
        </div>
    </div>
</div>
<script type="application/javascript">

    var mobile_regex = /^1[3|4|5|7|8][0-9]{9}$/;

    function validate_userMobile() {
        var mobile_val = $("#mobile1").val();
        var result = mobile_regex.test(mobile_val);
        if (result == true) {
            console.info('成功');
            return true;
        } else {
            console.info('失败');
            return false;
        }
        return false;
    }

    /**
     * 用户手机号密码登录
     */
    function pwdLogin() {
        var mobileVal = $("#mobile1").val();
        var password = $("#passwordRepeat").val();
        var check_validate_result = validate_userMobile();
        if (check_validate_result){
            $.ajax({
                url:'http://localhost:8080/user/login',
                type:'POST',
                contentType: "application/x-www-form-urlencoded",
                dataType:'JSON',
                data:{mobile:mobileVal,password:password},
                success:function (msg) {
                    console.info(msg);
                },
                error:function (error) {
                    console.info(error);
                }
            });
        }else{
            /*提示用户哪错了*/
            alert()
        }
    }



</script>
</body>


</html>